<?php

class IndexController extends AdminController {

	public function init() {

		C('LAYOUT', false);
		parent::init();
	}

	public function indexAction() {

		$zym_9 = new Tree(M('admin_node'));
		$zym_8 = array('status' => 1);

		if ($zym_10 = M('module')->where('status=0')->getfield('key', true)) {
			$zym_8['module'] = array('not in', $zym_10);
		}
		if ($_SESSION['admin']['userid'] != '1') {

			$zym_8['id'] = array('in', dc::get('admin_group', $_SESSION['admin']['groupid'], 'node'));
		}
		$this->menu = $zym_9->getSonList(0, 'id,name,module,controller,action', $zym_8);
		$this->display();
	}

	public function welcomeAction() {

		$zym_7 = array();

		if (C('appid') == 'test') {
			$zym_7[] = array('type' => 'danger', 'content' => '您当前使用的APPID为test，请抓紧时间申请正式APPID，否则您可能会无法使用我们的API服务！<a href="' . U('admin.set.api') . '">点击这里更换</a>');
		}

		if (C('adminpath') == 'admin') {
			$zym_7[] = array('type' => 'warning', 'content' => '您后台目录为默认的admin，为安全考虑，请您更改目录地址！<a href="' . U('admin.set.base') . '">点击这里更换</a>');
		}
		$zym_5 = M('user')->count();

		$this->sitenum = 1;
		$this->usernum = $zym_5;
		$this->adnum = 1;
		$this->friendlinknum = count(C('friendlink'));
		$this->tips = $zym_7;
		$this->display();
	}

	/**
	 * 获取版本信息
	 */
	public function getInfoAction() {
		$data = file_get_contents("https://gitee.com/midoks/ncms/raw/master/info.txt");
		echo $data;
	}

	public function systemAction() {
		phpinfo();
	}
}
?>